package com.physics.mps.module.setting;

import com.physics.mps.common.util.LoginUtil;
import com.physics.mps.entity.vo.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author mcsoft
 * @date 2023/09/14 14:51
 **/
@Api(tags = "设置中心")
@RestController
@RequestMapping(value = "/setting")
@RequiredArgsConstructor
public class SettingController {

    private final SettingService settingService;


    @ApiOperation(value = "查询分组")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "authorization", value = "authorization", dataType = "String", required = true),
            @ApiImplicitParam(paramType = "path", name = "appId", value = "仿真软件ID", dataType = "String", required = true),
            @ApiImplicitParam(paramType = "path", name = "moduleId", value = "仿真模块ID", dataType = "String", required = true),
    })
    @PostMapping("/listGroup/{appId}/{moduleId}")
    public ResponseResult listGroup(@PathVariable("appId") String appId, @PathVariable("moduleId") String moduleId) {
        Integer userId = LoginUtil.getUserId();
        return ResponseResult.success(settingService.listGroup(appId, moduleId,userId));
    }
}
